<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css">
    <script>
        var ctx = "${ctx}";
    </script>
</head>
<body>
<form class="layui-form" style="width: 80%;">
    <!--管理员id 这个必须要有 因为底层sql是根据id来更新的
    但是password和 status其他字段可有可无 但是类型和名称必须一样 不然会绑定错误
    ajax无法进去controller
    -->
    <input type="hidden" name="book_id" value="${book.book_id}" id="book_id"/>
    <input type="hidden" id="photo_path"  name="photo_path" value=""/>




    <div class="layui-form-item">
        <label class="layui-form-label">图书名称</label>
        <div class="layui-input-block">
            <input type="text" id="name" class="layui-input userName"
                   lay-verify="required" placeholder="请输入图书名称" name="name" value="${book.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图书作者</label>
        <div class="layui-input-block">
            <input type="text" id="author" class="layui-input userName"
                   lay-verify="required" placeholder="图书作者" name="author" value="${book.author}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">出版社</label>
        <div class="layui-input-block">
            <input type="text" id="publish" class="layui-input userName"
                   lay-verify="required" placeholder="出版社" name="publish" value="${book.publish}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">ISBN</label>
        <div class="layui-input-block">
            <input type="text" id="ISBN" class="layui-input userName"
                   lay-verify="required" placeholder="ISBN" name="ISBN" value="${book.ISBN}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">简介</label>
        <div class="layui-input-block">
            <input type="text" id="introduction" class="layui-input userName"
                   lay-verify="required" placeholder="简介" name="introduction" value="${book.introduction}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">语言</label>
        <div class="layui-input-block">
            <input type="text" id="language" class="layui-input userName"
                   lay-verify="required" placeholder="语言" name="language" value="${book.language}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">价格</label>
        <div class="layui-input-block">
            <input type="text" id="price" class="layui-input userName"
                   lay-verify="required" placeholder="价格" name="price" value="${book.price}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">出版日期</label>
        <div class="layui-input-inline">
            <input type="text" id="pub_date" name="pub_date" class="layui-input"
                   lay-verify="required" placeholder="请输入出版日期" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">所属分类</label>
        <div class="layui-input-block">
            <select name="class_id">
                <option value="">请选择</option>
                <c:forEach items="${classes}" var="c">
                    <option value="${c.class_id}">${c.class_name}</option>
                </c:forEach>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数量</label>
        <div class="layui-input-inline">
            <input type="text" id="number" name="number" class="layui-input"
                   lay-verify="required" placeholder="请输入图书数量" value="${book.number}">
        </div>
    </div>

    <div class="layui-upload">
        <label for="author" class="layui-form-label">
            <span class="x-red">*</span>图书封面</label>
        <div class="layui-input-inline">
            <button type="button" class="layui-btn" id="test3">上传图书封面</button>
            <div class="layui-upload-list">
                <img class="layui-upload-img" id="demo1" width="100px" height="100px">
                <p id="demoText"></p>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="updateBook">立即保存</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
<script type="text/javascript" src="${ctx }/js/book/editBook.js"></script>
<script type="text/javascript" src="${ctx }/js/pubilc.js"></script>
</body>
</html>















